package com.ruoyi.user.service.impl;

import com.ruoyi.user.domain.AppRoleMenu;
import com.ruoyi.user.mapper.AppRoleMenuMapper;
import com.ruoyi.user.service.AppRoleMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Set;

@Service
public class AppRoleMenuServiceImpl implements AppRoleMenuService {

    @Autowired
    private AppRoleMenuMapper appRoleMenuMapper;

    @Override
    public int addAppRoleMenu(AppRoleMenu appRoleMenu) {
        return appRoleMenuMapper.insertAppRoleMenu(appRoleMenu);
    }

    @Override
    public int removeAppRoleMenu(Integer roleId) {
        return appRoleMenuMapper.deleteAppRoleMenu(roleId);
    }

    @Override
    public int editAppRoleMenu(AppRoleMenu appRoleMenu) {
        return appRoleMenuMapper.updateAppRoleMenu(appRoleMenu);
    }

    @Override
    public Set<String> getAppRoleMenu(Integer roleId) {
        return appRoleMenuMapper.selectAppRoleMenu(roleId);
    }
}
